Imports System.Xml.Serialization
Namespace CSDL

    ''' <summary>
    ''' Controls the scope of entities and associations in the object model
    ''' </summary>
    Public Class EntityContainer
        Inherits XEntityModelElementWithDocumentationBase

        ''' <summary>Initializes an instance of the <see cref="EntityContainer" /> class.
        ''' This is the default constructor for this class.</summary>
        Public Sub New()
            MyBase.New("EntityContainer", EdmXmlNamespace)
        End Sub

        ''' <summary>Initializes an instance of the <see cref="EntityContainer" /> class.</summary>
        ''' <param name="other">An <see cref="System.Xml.Linq.XElement"/> object to copy from.</param>
        Public Sub New(ByVal other As XElement)
            MyBase.New(other)
        End Sub

        Private __AssociationSets As EntityContainerAssociationSetCollection
        Private __EntitySets As EntityContainerEntitySetCollection
        Private __FunctionImports As EntityContainerFunctionImportCollection

        ''' <summary>
        ''' Gets or sets the name of the <see cref="EntityContainer"/>.
        ''' </summary>
        <XmlAttribute()> _
        <AutoLoad()> _
        <XmlElement("AssociationSet", GetType(EntityContainerAssociationSet))> _
        Public ReadOnly Property AssociationSets() As EntityContainerAssociationSetCollection
            Get
                If (__AssociationSets Is Nothing) Then
                    __AssociationSets = New EdmxEditor.CSDL.EntityContainerAssociationSetCollection(Me, MyBase.Name.Namespace, "AssociationSet")
                End If
                Return __AssociationSets
            End Get
        End Property

        <AutoLoad()> _
        <XmlElement("EntitySet", GetType(EntityContainerEntitySet))> _
        Public ReadOnly Property EntitySets() As EntityContainerEntitySetCollection
            Get
                If (__EntitySets Is Nothing) Then
                    __EntitySets = New EdmxEditor.CSDL.EntityContainerEntitySetCollection(Me, MyBase.Name.Namespace, "EntitySet")
                End If
                Return __EntitySets
            End Get
        End Property

        <AutoLoad()> _
        <XmlElement("FunctionImport", GetType(EntityContainerFunctionImport))> _
        Public ReadOnly Property FunctionImports() As EntityContainerFunctionImportCollection
            Get
                If (__FunctionImports Is Nothing) Then
                    __FunctionImports = New EdmxEditor.CSDL.EntityContainerFunctionImportCollection(Me, MyBase.Name.Namespace, "FunctionImport")
                End If
                Return __FunctionImports
            End Get
        End Property

        Public Shadows Property Name() As String
            Get
                Return Me.@Name
            End Get
            Set(ByVal value As String)
                Me.@Name = value
            End Set
        End Property

        ''' <summary>
        ''' Gets or sets the name of the base container that this instance of <see cref="EntityContainer"/> extends.
        ''' </summary>
        ''' <value>The name of the base container that this instance of <see cref="EntityContainer"/> extends.</value>
        <XmlAttribute()> _
        Public Property Extends() As String
            Get
                Return Me.@Extends
            End Get
            Set(ByVal value As String)
                Me.@Extends = value
            End Set
        End Property

    End Class

End Namespace